$N.databaseSet.HealthInputDataTable = (function ($N) {    
    function init() {
    	var tableName = "HealthInputData";
    	var fields = new Array("personID varchar(15),\
                                valueType int, \
    							valueData varchar(50), \
                                valueLocation varchar(20),\
                                valueTime varchar(14)");

    	$N.databaseSet.createTableWithPrimaryKey(tableName, fields, "id", function () {
    		console.log("HealthInputDataTable is created successfully");
    	});
    }

    
    function addHealthInputData(data, successCallback, errorCallback) {
        var sqlCommand =  "INSERT INTO HealthInputData " + "(personID, valueType, valueData, valueLocation, valueTime) \
						        values(?, ?, ?, ?,?)";
        var sqlValueArray =new Array(data.personID, data.valueType, data.valueData, data.valueLocation, data.valueTime);
        $N.databaseSet.executeSQL($N.databaseSet.db, sqlCommand, sqlValueArray, successCallback, errorCallback);
    }

	function getHealthInputData(personID, successCallback, failCallback) {
		var db = $N.databaseSet.db;
		var sqlCommand = "SELECT * FROM HealthInputData WHERE personID = ?";
		$N.databaseSet.executeSQL(db, sqlCommand, [personID], successCallback, failCallback);
	}

    
	return {
        init:           init,
		getHealthInputData : getHealthInputData,
        addHealthInputData : addHealthInputData,
     
	}

}
	($N));